package com.keyrus.order.pojo;

import lombok.Data;

/**
 * 自定义响应结构
 */
@Data
public class KomsResult
{

    // 响应业务状态
    private Boolean success;

    // 响应消息
    private String message;

    // 响应中的数据
    private Object data;

    public static KomsResult build(Boolean success, String message, Object data) {
        return new KomsResult(success, message, data);
    }

    public KomsResult() {

    }

    public static KomsResult build(Boolean success, String message) {
        return new KomsResult(success, message, null);
    }

    public KomsResult(Boolean success, String message, Object data) {
        this.success = success;
        this.message = message;
        this.data = data;
    }

    public KomsResult(Object data) {
        this.success = true;
        this.message = "OK";
        this.data = data;
    }



}
